package com.example.demodb.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;

@Entity
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "song_song")
public class SongSong {
    @Column//加了@column后,就会在数据库中自动生成  user_id 这种命名格式的键
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "song1_id")
    @JsonIgnoreProperties("song1Song2s")
    private Song song1;

    @ManyToOne
    @JoinColumn(name = "song2_id")
    @JsonIgnoreProperties("song2Song1s")
    private Song song2;

    private Double sim=0.0;
}
